package com.sihai.ehr.model.biz;

import com.sihai.core.BaseEntity;
import com.sihai.ehr.model.sys.AuditStatus;
import com.sihai.ehr.model.sys.Organization;

import javax.persistence.*;

/**
 * @author: wxn
 * @since: 12-6-24 下午1:15
 */
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "auditing_type", discriminatorType = DiscriminatorType.STRING, length = 50)
public class AuditingBase extends BaseEntity<Long> {

    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = -3270612230995962389L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    private String auditContent; /* 审核意见 */

    @Enumerated(EnumType.STRING)
    private AuditStatus status; /* 审核结果 */

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "auditing_id")
    private Auditing auditing; /* 审核流程  */

    private boolean cancel; /* 是否删除 */

    private int auditNo; /*审核编数(第几次审核)*/

    private boolean last; //是否是最后一个

    @Override
    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getAuditContent() {
        return auditContent;
    }

    public void setAuditContent(String auditContent) {
        this.auditContent = auditContent;
    }

    public AuditStatus getStatus() {
        return status;
    }

    public void setStatus(AuditStatus status) {
        this.status = status;
    }

    public Auditing getAuditing() {
        return auditing;
    }

    public void setAuditing(Auditing auditing) {
        this.auditing = auditing;
    }

    public boolean isCancel() {
        return cancel;
    }

    public void setCancel(boolean cancel) {
        this.cancel = cancel;
    }

    public int getAuditNo() {
        return auditNo;
    }

    public void setAuditNo(int auditNo) {
        this.auditNo = auditNo;
    }

    public boolean isLast() {
        return last;
    }

    public void setLast(boolean last) {
        this.last = last;
    }
}
